<%@ include file="/jsps/vijayan/profile/init.jsp" %>

<portlet:renderURL var="addProfilePageURL">
	<portlet:param name="jspPage" value="/jsps/vijayan/profile/edit_profile.jsp"></portlet:param>
</portlet:renderURL>
<a href="<%= addProfilePageURL %>">Add Profile</a>
<liferay-ui:search-container emptyResultsMessage="No Recors Available">
	<liferay-ui:search-container-results 
		results="<%= ProfileLocalServiceUtil.getProfiles(searchContainer.getStart(), searchContainer.getEnd()) %>"
		total="<%= ProfileLocalServiceUtil.getProfilesCount() %>"
	/>

	<liferay-ui:search-container-row
		className="com.vijayan.profile.model.Profile"
		modelVar="profile"
	>
		<%
			String profileId = profile.getProfileId() + "";
		%>
		<portlet:renderURL var="editProfilePageURL">
			<portlet:param name="jspPage" value="/jsps/vijayan/profile/edit_profile.jsp"></portlet:param>
			<portlet:param name="profileId" value="<%= profileId %>"></portlet:param>
		</portlet:renderURL>
		<portlet:renderURL var="viewProfilePageURL">
			<portlet:param name="jspPage" value="/jsps/vijayan/profile/view_profile.jsp"></portlet:param>
			<portlet:param name="profileId" value="<%= profileId %>"></portlet:param>
		</portlet:renderURL>
		<portlet:actionURL var="deleteProfileURL">
			<portlet:param name="<%= ProfileConstants.ACTION %>" value="<%= ProfileConstants.DELETE_PROFILE %>"></portlet:param>
			<portlet:param name="profileId" value="<%= profileId %>"></portlet:param>
		</portlet:actionURL>
		<liferay-ui:search-container-column-text property="profileCode" />

		<liferay-ui:search-container-column-text property="religion" />

		<liferay-ui:search-container-column-text property="profileName" />

		<liferay-ui:search-container-column-text property="gender" />

		<liferay-ui:search-container-column-text property="age" />
		
		<liferay-ui:search-container-column-text name="action">
			<liferay-ui:icon-menu showArrow="false" showWhenSingleIcon="true" align="left"> 
				<liferay-ui:icon message="edit" url="<%= editProfilePageURL %>"/>
				<liferay-ui:icon message="view" url="<%= viewProfilePageURL %>"/>
				<liferay-ui:icon-delete url="<%= deleteProfileURL %>"/>
			</liferay-ui:icon-menu>
		</liferay-ui:search-container-column-text>
	</liferay-ui:search-container-row>

	<liferay-ui:search-iterator />
</liferay-ui:search-container>